import request from '/@/utils/request';

/**
 * 用户接口
 * @method getUserList 获取用户列表
 * @method allMenu 获取菜单接口，平铺
 * @method saveOrUpdateMenu 更新保存菜单
 */
export function useRolesApi() {
    return {
        getList: (data) => {
            return request({
                url: '/roles/list',
                method: 'POST',
                data,
            });
        },
        saveOrUpdate(data) {
            return request({
                url: '/roles/saveOrUpdate',
                method: 'POST',
                data
            })
        },
        deleted(data) {
            return request({
                url: '/roles/deleted',
                method: 'POST',
                data
            })
        },
        // 获取所有菜单，嵌套
        getAllProjects: () => {
            return request({
                url: '/roles/getAllProjects',
                method: 'POST',
                data: {},
            });
        },
    };
}
